package sdau.hjk.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import sdau.hjk.entity.ManagerNotice;

import java.util.List;

/**
 *@version 1.0
 *@author: huangjiakai
 *@create:2021−03-29 15:18
 *@className:sdau.hjk.dao.IManagerNotice
 *@description: TODO
 */
@Repository
public interface IManagerNoticeDao {
    //查询所有公告
    @Select("select * from notice order by date desc")
    public List<ManagerNotice> findAll();
    //根据id查询公告
    @Select("select * from notice where id = #{id}")
    public ManagerNotice findById(Integer id);
    //保存公告
    @Insert("insert into notice(id,title,body,date) values(#{id},#{title},#{body},#{date})")
    public void save(ManagerNotice managerNotice);
}
